<?php
/**
 * 管理评论
 * $Id: manage_comment.php 208 2010-11-19 01:57:17Z bwanglei@gmail.com $
 */

require_once './globals.php';
require_once AW_ROOT.'/model/class.comment.php';

$aw_com = new awComment();
$blog_title = '管理评论 - '.$blogname;

//删除帖子
if ($_SERVER['REQUEST_METHOD']=='POST' && $action=='del') {
	$id_comment = $_POST['id_comment'];
	$aw_com->delComment($id_comment);
	$CACHE->updateCache('comment');
	$CACHE->updateCache('sta');
	header('Location: '.$_SERVER['REQUEST_URI']);exit;
}

$bookmark = isset($_GET['b']) ? $_GET['b'] : '';
$result_array = $aw_com->get_comment_root($bookmark);
$comments = $result_array[0];
$pre_bookmark = $result_array[1];
$next_bookmark = $result_array[2];

include_once TEMPLATE_PATH.'/header.php';
include_once TEMPLATE_PATH.'/manage_comment.php';
include_once TEMPLATE_PATH.'/sidebar.php';
include_once TEMPLATE_PATH.'/footer.php';
